import { Tools } from 'weaver-mobile';
const getLabel = Tools.getLabel;

export const URGENT_CONDITION = (key, title) => {
    let condition = {};
    if (key !== 'email') {
        condition = {
            'conditioninfo': [
              {
                'defaultshow': true,
                'items': [
                  {
                    "colSpan": 2,
                    "conditionType": "TEXTAREA",
                    "domkey": [`${key}Content`],
                    "fieldcol": 17,
                    "isQuickSearch": false,
                    "label": '',
                    "labelcol": 6,
                    "precision": 0,
                    "relatekey": "",
                    "viewAttr": 3,
                    "value": '',
                    otherParams: {
                      autoHeight: true,
                    }
                  }
                ]
              }
            ]
        }
    } else {
        condition = {
            'conditioninfo': [
              {
                'defaultshow': true,
                'items': [
                  {
                    "colSpan": 2,
                    "conditionType": "INPUT",
                    "domkey": [
                      "emailContent"
                    ],
                    "fieldcol": 17,
                    "isQuickSearch": false,
                    "label": getLabel('516781','邮件主题'),
                    "labelcol": 6,
                    "precision": 0,
                    "relatekey": "",
                    "viewAttr": 3,
                    'detailtype': 3,
                    "value": "",
                    'tipPosition': 'bottom'
                  },
                  {
                    "colSpan": 2,
                    "conditionType": "RICHTEXT",
                    "domkey": [
                      "emailRichContent"
                    ],
                    "fieldcol": 17,
                    "isQuickSearch": false,
                    "label": '',
                    "labelcol": 6,
                    "precision": 0,
                    "relatekey": "",
                    "viewAttr": 2,
                    "value": "",
                    otherParams: {
                      autoHeight: true,
                    }
                  }
                ]
              }
            ]
          }
    }
    return condition
}